Skip to content

Fix OOC messages advancing roleplay chat activity - #75

Merged
ryanbarlow97 merged 1 commit into
mainfrom
fix/ooc-chat-activity
Sep 25, 2026
Merged

ryanbarlow97 merged 1 commit into
mainfrom
fix/ooc-chat-activity

Conversation

@ryanbarlow97

@ryanbarlow97 ryanbarlow97 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

OOC messages could advance the Roleplay Chat activity because ActivityTF handled every CharacterChatEvent without checking its channel. Length and repetition filters made the incorrect credit appear intermittent.

Restrict credit to RPCharacters roleplay channel IDs (rp, whisper, shout, yell, action, scene, dm) before updating progress or repetition history. OOC, staff, unknown and missing channels are ignored for both ordinary chat and commands.

Validation: reproduced the bug with 11 failing channel cases before the fix; all 769 tests pass after the fix, including 26 new event-level regression cases. Java 21 mvn clean verify, artifact validation and git diff --check passed.

Summary by CodeRabbit

  • Bug Fixes
    • Roleplay activity credit is now limited to messages sent through recognized roleplay channels. Messages in other or unspecified channels no longer count toward roleplay activity.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0e40aeb3-adde-470a-936d-3f92fc753b8b

📥 Commits

Reviewing files that changed from the base of the PR and between 8f30dca and 1b43b5b.

📒 Files selected for processing (2)
  • src/main/java/net/tfminecraft/activitytf/listeners/CharacterChatListener.java
  • src/test/java/net/tfminecraft/activitytf/listeners/CharacterChatChannelTest.java

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The listener now counts roleplay activity only for events with a non-null channel whose name matches the configured roleplay channels, without regard to letter case. Tests cover rejected channels, accepted channels, command events, and repeated events.

Changes

Roleplay Chat Activity

Layer / File(s) Summary
Channel filter and coverage
src/main/java/net/tfminecraft/activitytf/listeners/CharacterChatListener.java, src/test/java/net/tfminecraft/activitytf/listeners/CharacterChatChannelTest.java
The listener accepts seven configured roleplay channel names after case normalization and returns early for null or unlisted channels. Tests check that rejected channels do not add activity or history, and that accepted channels count once for command and non-command events.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 1b43b

No concrete behavior defect was established in the filter or its tests. The change appears mergeable subject to normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 1b43b

The new channel check narrows roleplay activity credit rather than expanding access. No introduced security issue was established, although the upstream chat plugin’s channel guarantees could not be independently verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The directly evidenced outcome is roleplay-chat progress for the event sender’s UUID within ActivityTF. The change does not add a recording sink or a new plugin registration path.

Trust Boundaries and Controls

  • inferred — The listener treats the upstream event’s channel as the eligibility input and now restricts it before granting credit. The external event producer’s channel provenance could not be verified, so the filter is not evidence of independent channel authentication.

Resilience and Maintainability Implications

  • inferred — History uses an unsynchronized map and deque, and recording follows the history update. The available source does not establish concurrent event delivery or recovery semantics; neither behavior is shown to be introduced by this PR.

Hardening Proposals

  • proposed — Confirm the upstream event’s channel provenance and delivery-thread contract before relying on those properties as guarantees for activity eligibility and repetition-history integrity.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing OOC messages from advancing roleplay chat activity.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

A rabbit checks the channel names,
And lets roleplay earn its claims.
Null and unknown chats pass by,
While counted messages hop nearby.
The tests keep watch with ears held high.

Comment @coderabbitai help to get the list of available commands.

@ryanbarlow97
ryanbarlow97 merged commit 583b743 into main Sep 25, 2026
2 checks passed
@ryanbarlow97
ryanbarlow97 deleted the fix/ooc-chat-activity branch September 25, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant